/*
 * HackSQL
 * Copyright (C) 2008-2009
 *
 * Authors: Felipe Nascimento Silva Pena
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef HACKSQL_PARSER_COMMON_H
#define HACKSQL_PARSER_COMMON_H

#include <hacksql/hs_types.h>

typedef enum {
	OP_SELECT,
	OP_INSERT,
	OP_UPDATE,
	OP_DELETE,
	OP_CREATE,
	OP_COLUMN,
	OP_COMMIT,
	OP_ROLLBACK
} hs_op;

typedef struct {
	hs_op op_type;
	struct {
		union {
			hs_string *str;
			hs_uint num;
		} data;
		hs_short type;
	} val;
} hs_node;

typedef struct {
	
} hs_plan;

#define YYSTYPE hs_node

extern int hs_parser_query(const char *query);
extern void yyerror(const char* s);

#endif
